import java.util.Scanner;

public class NarcissisticNumber {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n= scanner.nextInt();
        int sum=0;
        for (int i = 100; i <= n; i++) {
            int a=i%10;
            int b=i%100/10;
            int c=i/100;
            sum=a*a*a+b*b*b+c*c*c;

            if(sum==i){
                System.out.println(i);
                System.out.println("是水仙花数");
            }

        }

    }

}


